<%= turbo_frame_tag :resource_form, target: "_top" do %>
  <%= render component("ui/modal").new(title: t(".title")) do |modal| %>
    <%= solidus_form_for @store_credit, url: form_url, method: :put, html: { id: form_id } do |f| %>
      <div class="flex flex-col gap-6 pb-4">
        <%= f.text_field(:amount, class: "required") %>
        <%= f.select(
          :store_credit_reason_id,
          @store_credit_reasons.map { [_1.name, _1.id] },
          include_blank: t('.choose_reason'),
          html: { required: true }
        ) %>
      </div>
      <% modal.with_actions do %>
        <form method="dialog">
          <%= render component("ui/button").new(scheme: :secondary, text: t('.cancel')) %>
        </form>
        <%= f.submit %>
      <% end %>
    <% end %>
  <% end %>
<% end %>
